package com.ruoyi.resume.service.impl;

import com.ruoyi.resume.mapper.ResumeTagMapper;
import com.ruoyi.resume.service.TaskProcessor;
import org.springframework.stereotype.Component;

@Component
public class DeleteTagProcessor implements TaskProcessor {
    private final ResumeTagMapper resumeTagMapper;

    public DeleteTagProcessor(ResumeTagMapper resumeTagMapper) {
        this.resumeTagMapper = resumeTagMapper;
    }

    @Override
    public void process(Integer tagId) {
        try {
            resumeTagMapper.deleteByTagId(tagId);
            System.out.println("成功删除标签任务，Tag ID：" + tagId);
        } catch (Exception e) {
            System.err.println("删除任务失败，Tag ID：" + tagId + "，错误：" + e.getMessage());
        }
    }
}

